<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>DBLParse</title>
    <link rel="stylesheet" href="bootstrap.min.css">
    <link rel="stylesheet" href="bootstrap-select.min.css">
    <link rel="stylesheet" href="util.css">
    <link rel="stylesheet" href="index.css">
</head>

<body>
    <div class="container">
        <h1 class="display-1 text-center my-5" style="font-family: Belgrano;">DBLParse</h1>
        <form action="javascript:void(0)">
            <div id="inputs" class="input-group">
                <div class="input-group-prepend">
                    <select
                        id="type"
                        data-style="btn-outline-info"
                        v-model="type"
                    >
                        <option
                            v-bind:value="item"
                            v-for="item in type_list"
                            tr
                        >{{ item }}</option>
                    </select>
                </div>
                <input
                    type="text"
                    class="form-control"
                    id="word"
                    v-on:keyup.enter="handleInput"
                    v-model="word"
                >
                <div class="input-group-append">
                    <button
                        class="btn btn-outline-success px-4"
                        id="search"
                        v-on:click="handleInput"
                        tr
                    >Search</button>
                </div>
            </div>
        </form>

        <div
            id="alert"
            class="mt-5 alert alert-dismissible fade show col-4"
            style="margin: 0 auto;"
            v-show="seen"
            v-bind:class="'alert-'+type"
        >
            <span v-html="tr(message)"></span>
        </div>
        
        <div id="result" v-show="status == 'show_result'"
            style="display: none;">
            <a class="link-card mt-5 mx-auto text-decoration-none"
               style="display: block;"
               v-show="type == 'author' && homepage_id != -1"
               v-bind:href='homepageHref'
            >
                <div class="d-flex justify-content-between align-items-center">
                    <div class="float-left text-left">
                        <div class="my-1" style="font-size: 22px;" tr>Home Page</div>
                        <div id="homepage-meta" class="text-muted"> {{ word }} </div>
                    </div>
                    <img src="homepage.svg" alt="homepage" class="float-right" width="60" height="60">
                </div>
            </a>
            <table
                class="table table-bordered table-hover table-striped my-5"
                v-show="table.length != 0"
                style="table-layout: fixed;"
            >
                <thead class="thead-light">
                    <tr>
                        <th 
                            v-for="(head, i) in header[type]" 
                            v-bind:width="header_width[type][i]"
                            v-html="translate(head)"
                            v-bind:tr="head"
                        ></th>
                    </tr>
                </thead>
                <tbody>
                    <tr v-for="row in table">
                        <td v-for="col in row"
                            v-html="col"
                        ></td>
                    </tr>
                </tbody>
            </table>
        </div>
        
        <div class="my-5" id="coGraph" style="display: none;">
            <div id="graph"></div>
            <button class="btn btn-outline-success float-right my-5" id="save" tr>Save</button>
        </div>
    </div>

    <script src="vue.min.js"></script>
    <script src="jquery.slim.min.js"></script>
    <script src="popper.min.js"></script>
    <script src="bootstrap.min.js"></script>
    <script src="bootstrap-select.min.js"></script>
    <script src="echarts.min.js" defer></script>
    <script src="util.js"></script>
    <script src="index.js"></script>
</body>

</html>
